/*
 * =====================================================================================
 *
 *       Filename:  main.c
 *
 *    Description:  Test functions. 
 *
 *        Version:  1.0
 *        Created:  10/10/2010 03:14:11 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Justin Lei GAO (leikao), leikao@gmail.com
 *        Company:  
 *
 * =====================================================================================
 */

#include	"c_string.h"



#include	<stdlib.h>
#include	<stdio.h>

/* 
 * ===  FUNCTION  ======================================================================
 *         Name:  main
 *  Description:  
 * =====================================================================================
 */
    int
main ( int argc, char *argv[] )
{
    char* src = "        A Test                  String.    "; 
    char dst[MAX_STRING_LEN + 1] = {0}; 

    int rc = strip_head(src, dst); 
    printf ( "RetCode: %d\nString: %s\n", rc, dst );

    rc = strip_tail(src, dst); 
    printf ( "RetCode: %d\nSrc: %s\nDst: %s\n", rc, src, dst );

    rc = strip(src, dst); 
    printf ( "RetCode: %d\nSrc: %s\nDst: %s\n", rc, src, dst );

    rc = strip_all(src, dst); 
    printf ( "RetCode: %d\nSrc: %s\nDst: %s\n", rc, src, dst );

    rc = get_fields_num(src); 
    printf ( "RetCode: %d\nSrc: %s\nDst: %s\n", rc, src, src );

    rc = get_field_value(src, 2, dst); 
    printf ( "RetCode: %d\nSrc: %s\nDst: %s\n", rc, src, dst );

    return EXIT_SUCCESS;
}				/* ----------  end of function main  ---------- */
